<template>
  <el-tree
    :data="treeData"
    :props="defaultProps"
    class="padding"
    :default-expand-all="false"
    highlight-current
    node-key="code"
    v-bind="$attrs"
    v-on="$listeners"
  ></el-tree>
</template>

<script>
export default {
  name: 'area-tree',
  data () {
    return {
      defaultProps: { label: 'name', children: 'children', isLeaf: 'isLeaf' },
    }
  },
  computed: {
    treeData () {
      return this.$store.getters['user/districts']
    },
  },
}
</script>
